FROM ubuntu:trusty

MAINTAINER caoyong <caoyong2619@gmail.com>

ENV DEBIAN_FRONTEND noninteractive
ENV WWW_DIR /usr/share/nginx/html
ENV WE7_ADMIN_USERNAME admin
ENV WE7_ADMIN_PASSWORD admin
ENV WE7_DB_NAME we7
ENV WE7_TABLE_PREFIX we7

EXPOSE 80

COPY ./sources.list /etc/apt/sources.list
COPY ./install/ /usr/src/install/

RUN apt-get update \
        && apt-get install -y nginx curl unzip php5-fpm php5-mysql php5-gd\
        && curl 'http://bbs.we7.cc/forum.php?mod=attachment&aid=NTQyM3xjYzUxZGQ5OXwxNDM2NzY0Mjk3fDB8Mjk1OQ%3D%3D' -o $WWW_DIR/we7.zip \ 
        && chmod +x /usr/src/install/install.sh
        
CMD ["usr/src/install/install.sh"]